/*
 * Class.h
 *
 *  Created on: Aug 5, 2009
 *      Author: ramesh
 */

#ifndef _COMPOSER_CLASS_H_
#define _COMPOSER_CLASS_H_

#include "Entity.h"
#include "Context.h"
#include "Method.h"

#include "../../Shared.h"


namespace SymphonyAST {


class Class : public Context, public Entity {
private:
	map<string, Method*> methods;
	vector<string> membersList;
	vector<string> methodsList;
	vector<Class*> importeds;
	set<string> properties;
	int importIndex;
	string name;

public:
	Class() {
		for (int i = 0; i <= Types::PRIMITIVES_NUMBER; i++) {
			Class* temp = new Class(true);
			temp->name = Types::getTypeKeyword(i);
			importeds.push_back(temp);
		}
	}
	Class(bool noImport) { }

	string getId() {
		return "class";
	}

	string getName();
	void setName(string name);

    void import(Class* toImport);
    int getImportedId(string imported);

    Class* getImported(int i);
    vector<Class*> getImporteds();

    Method* getMethod(string name);
    map<string, Method*> getMethods();

    int getMethodId(string name);
    vector<string> getMethodsIds();

    void addMethod(string name, Method* method);

    Variable* getVariable(const string& name);
    void addVariable(string name, Variable* member);

    vector<string> getMembersIds();
};


}

#endif /* _COMPOSER_CLASS_H_ */
